package com.lyz.dataStructure.xiancheng.读写锁;
/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/8/27 11:44
 *@Description:
 **/
public class Reader implements Runnable {
    private ReadWriteLockTest pricesInfo;
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.printf("%s: Price 1: %f\n", Thread.currentThread()
                    .getName(), pricesInfo.getPrice1());
            System.out.printf("%s: Price 2: %f\n", Thread.currentThread()
                    .getName(), pricesInfo.getPrice2());
        }
    }
    public Reader(ReadWriteLockTest pricesInfo) {
        this.pricesInfo = pricesInfo;
    }
}
